Xbasic

SelectBestProcessor Function

Syntax

Result_Flag as L = SelectBestProcessor()

Arguments

Result_Flag

.T. (TRUE) = The affinity was changed. .F. (FALSE) = The affinity was not changed.

Description

Select the most appropriate CPU (on a multi-processor system) for the process.

Discussion

SelectBestProcessor() assigns the process affinity to the highest CPU index (0, 1, ...) with the lowest number of occurrences of alpha5.exe, a5desktopserver.exe, and a5applicationserver.exe. Windows restricts visibility of other running processes on a computer based on user account permissions. This means that users without administrator level permissions will not be able to see the processes of other users. On a server where Alpha Anywhere is being run by multiple non-administrator users, such as in a Terminal Server configuration, SelectBestProcessor() may not be aware of the other instances being run. In this situation, the process affinity will likely be set to the same CPU index for all instances. An alternative to SelectBestProcessor() in these cases is to use SetPrimaryProcessor() to assign the running instance to a specific CPU index based on the user account.

Limitations

Windows restricts visibility of other running processes on a computer based on user account permissions.

See Also